<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8"/>
    <title>添加友情链接 - bjyadmin</title>
    <link rel="stylesheet" href="__ADMIN_STATICS__/bootstrap/dist/css/bootstrap.css" type="text/css" />
    <link rel="stylesheet" href="__ADMIN_STATICS__/animate.css/animate.css" type="text/css" />
    <link rel="stylesheet" href="__ADMIN_STATICS__/font-awesome/css/font-awesome.min.css" type="text/css" />
    <link rel="stylesheet" href="__ADMIN_STATICS__/simple-line-icons/css/simple-line-icons.css" type="text/css" />
    <link rel="stylesheet" href="__ADMIN_STATICS__/bootstrap-editable/css/bootstrap-editable.min.css" type="text/css" />
    <link rel="stylesheet" href="__ADMIN_STATICS__/app/css/font.css" type="text/css" />
    <link rel="stylesheet" href="__ADMIN_STATICS__/app/css/app.css" type="text/css" />
        <webuploadercss/>
</head>
<body>
<div class="wrapper-md">
    <div class="panel panel-default">
        <div class="panel-heading">
            <a href="{:U('Admin/Index/index')}"><i class="fa fa-home"></i>&nbsp;首页</a>&nbsp;&gt;<a href="{:U('Admin/Links/index')}">&nbsp;&nbsp;友情连接列表&nbsp;</a>&gt;&nbsp;&nbsp;添加友情连接
        </div>
        <div class="table-responsive">
            <form class="form-horizontal" action="{:U('Admin/Links/edit')}" method="post">
                <input type="hidden" name="id" value="{$data['id']}">
                <div class="line line-dashed b-b line-lg pull-in"></div>
                <div class="form-group m-b-none m-l-none m-r-none">
                    <label class="col-sm-2 control-label" for="input-id-1">名称：</label>
                    <div class="col-sm-6">
                        <input type="text" class="form-control" name="name" value="{$data['name']}" data-form-un="1470118834084.755">
                    </div>
                </div>
                 <div class="line line-dashed b-b line-lg pull-in"></div>
                <div class="form-group m-b-none m-l-none m-r-none">
                    <label class="col-sm-2 control-label" for="input-id-1">地址：</label>
                    <div class="col-sm-6">
                        <input type="text" class="form-control" name="link" value="{$data['link']}" data-form-un="1470118834084.755">
                    </div>
                </div>
                <div class="line line-dashed b-b line-lg pull-in"></div>
                <div class="form-group m-b-none m-l-none m-r-none">
                    <label class="col-sm-2 control-label" for="input-id-1">简介：</label>
                    <div class="col-sm-6">
                       <textarea class="form-control" name="desc" rows="3">{$data['desc']}</textarea><span>限100字</span>
                    </div>
                </div>      
                <div class="line line-dashed b-b line-lg pull-in"></div>
                <div class="form-group m-b-none m-l-none m-r-none">
                    <label class="col-sm-2 control-label" for="input-id-1">logo</label>
                    <div class="col-sm-6">
                       <img src="{$data['logo']}" height="150" width="auto">
                    </div>
                </div>                                                 
                <div class="line line-dashed b-b line-lg pull-in"></div>
                <div class="form-group m-b-none m-l-none m-r-none">
                    <label class="col-sm-2 control-label" for="input-id-1">上传logo：</label>
                    <div class="col-sm-6">
                       <!-- 上传组件容器 开始-->
                        <div id="pic_upload" class="xb-uploader">
                            <div class="queueList">
                                <div class="placeholder">
                                    <div class="filePicker"></div>
                                    <p>选择logo</p>
                                </div>
                            </div>
                            <div class="statusBar" style="display:none;">
                                <div class="progress">
                                    <span class="text">0%</span>
                                    <span class="percentage"></span>
                                </div>
                                <div class="info"></div>
                                <div class="btns">
                                    <div class="uploadBtn">开始上传</div>
                                </div>
                            </div>
                            <div class="attachment_list" style="display: none;">
                                <input name="logo" type="hidden" value="{$data['logo']}" />
                            </div>
                        </div>
                        <!-- 上传组件容器 结束-->
                    </div>
                </div>
                <div class="line line-dashed b-b line-lg pull-in"></div>
                <div class="form-group m-b-none m-l-none m-r-none">
                    <label class="col-sm-2 control-label" for="input-id-1">是否可见：</label>
                    <div class="col-sm-6">
                        <div class="radio">
                          <label class="i-checks i-checks-sm">
                            <input type="radio" name="display" value="1" <if condition="$data['display'] eq 1">checked</if>>
                            <i></i>
                            是
                          </label>
                           <label class="i-checks i-checks-sm">
                            <input type="radio" name="display" value="2" <if condition="$data['display'] eq 2">checked</if>>
                            <i></i>
                            否
                          </label>
                        </div>
                    </div>
                </div>
                <div class="line line-dashed b-b line-lg pull-in"></div>                    
                <div class="form-group m-l-none m-r-none">  
                    <div class="col-sm-4 col-sm-offset-2">
                        <button type="submit" class="btn btn-primary">提交</button>
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>
<script src="__ADMIN_STATICS__/jquery/jquery.min.js"></script>
<script src="__ADMIN_STATICS__/bootstrap/dist/js/bootstrap.js"></script>
<script src="__ADMIN_STATICS__/webuploader-0.1.5/webuploader.js"></script>
<script src="__ADMIN_STATICS__/webuploader-0.1.5/uploaderSf.js"></script>  
<script type="text/javascript">
$('#pic_upload').sfUpload({
    url:"{:U('Admin/Ad/ajax_upload')}",
    picker:'pic_upload',
    multiple:false,
    sizeLimit:1,
    success:function( data ) {
        $("input[name='logo']").val(data.path);
        console.log(data);
    },
    error:function( err ) {
        console.info( err );    
    }
});
</script>
</body>
</html>